package com.sai.jsai.common.base.vo;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author jisai
 * @version 0.0.1
 * @Description 分页结果
 * @createTime 2024/10/31
 */
//@Schema(description = "分页结果")
@Data
public final class PageResult<T> implements Serializable {

//    @Schema(description = "当前页的数据列表", requiredMode = Schema.RequiredMode.REQUIRED)
    private List<T> records;

//    @Schema(description = "当前页码", requiredMode = Schema.RequiredMode.REQUIRED)
    private long current;

//    @Schema(description = "每页记录数", requiredMode = Schema.RequiredMode.REQUIRED)
    private long size;

//    @Schema(description = "总记录数", requiredMode = Schema.RequiredMode.REQUIRED)
    private long total;

//    @Schema(description = "总页数", requiredMode = Schema.RequiredMode.REQUIRED)
    private long pages;

    public PageResult() {
    }

    public PageResult(List<T> records, long current, long size, long total, long pages) {
        this.records = records;
        this.current = current;
        this.size = size;
        this.total = total;
        this.pages = pages;
    }

}
